package traveldream.ejb.sessionBean;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import traveldream.ejb.DTO.HotelDTO;
import traveldream.ejb.entities.Hotel;
import traveldream.ejb.interfaces.HotelInsertionBeanLocal;

/**
 * Session Bean implementation class HotelInsertionBean
 */
@Stateless
public class HotelInsertionBean implements HotelInsertionBeanLocal {

	
	@PersistenceContext
	private EntityManager em;
	
    /**
     * Default constructor. 
     */
    public HotelInsertionBean() {
        // TODO Auto-generated constructor stub
    }
    
    public void insert(HotelDTO hDTO){
    		Hotel h = new Hotel(hDTO);
    		em.persist(h);
    }

}
